//
//  OYEmotionModel.swift
//  weiboCopycat
//
//  Created by Orange Yu on 2016/12/10.
//  Copyright © 2016年 Orange Yu. All rights reserved.
//

import UIKit

class OYEmotionModel: NSObject,NSCoding {

    /// 表情名称
    var chs:String?
    
    /// 图片名
    var png:String?
    
    /// 表情类型
    var type:String?
    
    /// emoji表情名
    var code:String?
    
    /// 图片的绝对路径
    var path:String?
    
    // 重写init方法
    override init() {
        super.init()
    }
    
    // 归档
    func encode(with aCoder: NSCoder) {
        aCoder.encode(chs, forKey: "chs")
        aCoder.encode(png, forKey: "png")
        aCoder.encode(type, forKey: "type")
        aCoder.encode(code, forKey: "code")
        aCoder.encode(path, forKey: "path")
    }
    // 解档
    required init?(coder aDecoder: NSCoder) {
        chs = aDecoder.decodeObject(forKey: "chs") as? String
        png = aDecoder.decodeObject(forKey: "png") as? String
        type = aDecoder.decodeObject(forKey: "type") as? String
        code = aDecoder.decodeObject(forKey: "code") as? String
        path = aDecoder.decodeObject(forKey: "path") as? String
        
    }
    
}
